package cn.stylefeng.guns.modular.business.custom.enums;

/**
 * 取车方式
 */
public enum TakeCarTypeEnum {

    SHANG_MEN_TI_CHE(1, "小板送车"),
    XIAO_BAN_SHANG_MEN(2, "人工送车"),
    ZI_SONG_WANG_DIAN(3, "自提"),
    ZHI_JIAO_KE_HU(4, "大板直交");

    TakeCarTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int type;

    public String desc;

    public static boolean valid(Integer type) {
        if (type == null) {
            return false;
        }
        TakeCarTypeEnum[] pts = TakeCarTypeEnum.values();
        for (TakeCarTypeEnum pt : pts) {
            if (type == pt.type) {
                return true;
            }
        }
        return false;
    }

    public static String getValue(Integer type) {
        if (type == null) {
            return "";
        }
        TakeCarTypeEnum[] pts = TakeCarTypeEnum.values();
        for (TakeCarTypeEnum pt : pts) {
            if (type == pt.type) {
                return pt.desc;
            }
        }
        return "";
    }
}
